package com.learm.annotation.test;

import com.learm.annotation.Table;
import org.junit.jupiter.api.Test;

public class Service {

    public static void main(String[] args){
        new Service().query(new Person());
    }
    
    @Test
    public String query(Object person){

        System.out.println(person.getClass().getTypeName());

        StringBuilder sql = new StringBuilder();
        Class p = person.getClass();
        boolean exist = p.isAnnotationPresent(Table.class);
        if(!exist){
            return  null;
        }

        Table table = (Table) p.getAnnotation(Table.class);
        String tableName = table.value();
        System.out.println(tableName);


        return null;
    }
}
